const path = require('path');
const merge = require('webpack-merge'); // 用于合并webpack配置
const baseConfig = require('./webpack.base')
const webpackNodeExternals = require('webpack-node-externals'); // 用于减少服务端打包体积

const config = {
    // 运行在什么环境下
    target: 'node',
    entry: './src/server/index.js',
    output: {
        path: path.join(__dirname, 'build'),
        filename: "bundle.js"
    },
    // 排除node系统模块
    externals: [webpackNodeExternals()]
}

module.exports = merge(baseConfig, config)